*********************************************** ISQ Data Archive File* Portraying the Global**********************************************

* Open Textbook Dataset

use "Textbook Data_ISQ_Cleaned.dta"

************************************************************************** TABLE 1: Descriptive Variables************************************************************************** Use Full Data Set with Missing Data Not Filled Intempname outcomes1tempfile results1postfile `outcomes1' str40(variable) Mean SD Min Max N using `results1'foreach var in globzn q33 pubdate logpage gradecat q34 hist citizens hrindex_all overallgl mig_perc hrtreaty loggdp polity2 logngo latcar eeur asia africa mena west {	if "`var'" == "globzn" local label "Mentions Globalization"	if "`var'" == "q33" local label "Mentions Global Citizenship"	if "`var'" == "pubdate" local label "Year"	if "`var'" == "logpage" local label "Logged Number of Pages"	if "`var'" == "gradecat" local label "Grade Category"	if "`var'" == "q34" local label "Level of Internationalization"		if "`var'" == "hist" local label "History"		if "`var'" == "hrindex_all" local label "HR Index"	if "`var'" == "overallgl" local label "Overall Globalization"	if "`var'" == "loggdp" local label "Log GDP"	if "`var'" == "polity2" local label "Level of Democratization"	if "`var'" == "logngo" local label "Log INGO Memberships"	if "`var'" == "mig_perc" local label "Percent Migration"	if "`var'" == "hrtreaty" local label "HR Treaty Index"	if "`var'" == "citizens" local label "Citizenship Issues"	if "`var'" == "latcar" local label "Latin America"	if "`var'" == "eeur" local label "Eastern Europe"	if "`var'" == "asia" local label "Asia"	if "`var'" == "africa" local label "Africa"	if "`var'" == "mena" local label "MENA"	if "`var'" == "west" local label "West"						qui su `var', detail					local mean 	=r(mean)					local sd	=r(sd)					local n 	=r(N)					local min 	= r(min)					local max 	= r(max) 						post `outcomes1' ("`label'") (`mean') (`sd') (`min') (`max') (`n') 				}		postclose `outcomes1'use `results1', clear* Export Data Here

************************************************************************** Graph 1: Globalization*************************************************************************glob width  = 3cap drop year_bingen year_bin= $width*int((pubdate)/$width)cap drop tagegen tag = tag(year_bin)* Mean Globalization in Textbooksegen mean_glob = mean(globzn), by(year_bin)* Define country count of globalizationcap drop n_globby year_bin newid3 globzn, sort: gen n_glob = globzn if _n==1* We sort by date and country -- so we only look at different countries across different years-- yes or no globlab var n_glob "N. Countries Discuss Globalization Each Year"set more offlist year_bin country globzn n_glob*How many countries mentioned glob each year?bysort year_bin: egen s_glob=sum(n_glob)lab var s_glob "Number Countries Mentioning Glob. Each Year"list year_bin country globzn n_glob s_glob*How many total countries per year?cap drop n_countryby year_bin newid3, sort: gen n_country = 1 if _n==1cap drop s_countryby year_bin, sort: egen s_country = sum(n_country)list year_bin country n_country s_country*Proportion of Those Mentioning Globalization to Total Countriesgen country_prop = (s_glob)/(s_country)lab var country_prop "% Countries Discussing Globalization Each Year"codebook country_prop#delimit ; 	graph twoway 	(qfit country_prop year_bin if pubdate>1969, lc(black) lp(-))	(scatter country_prop year_bin if pubdate>1969, mc(black) msymbol(O) msize(small))	(qfit mean_glob year_bin if pubdate>1969, lc(black))	(scatter mean_glob year_bin if pubdate>1969, mc(black) msymbol(S) msize(small))	,	subtitle("Mentions of Globalization, 1970-2005")	xtitle("Year of Publication")	ytitle("Proportion")	legend(label(1 "Proportion of Textbooks")			label (2 "3-Year Average")			label(3 "Proportion of Countries")			label (4 "3-Year Average") row(2) pos(6)			order(1 3 2 4)
			size(*.80))	xlabel(1970[5]2005)
	ylabel(0[.1].6)	graphregion(color(white)); 		#delimit cr

************************************************************************** Graph 2: Global Citizenship*************************************************************************glob width  = 3cap drop year_bindrop if pubdate<1970gen year_bin= $width*int((pubdate)/$width)replace year_bin = 2004 if year_bin==2007* For Global Citizenship we actually believe that there is an upward global trend that is not well captured* In the most recent bin (2007) because the only textbooks in this bin are 2007 books, so we * Re-classify them within the 2004 bin
cap drop tagegen tag = tag(year_bin)* Then generate a textbook mean by year_binegen mean_cit = mean(q33_intlcitz), by(year_bin)* Then generate a country mean by year_bin; to do this, we first sort by year_bin and country, and then only count one observation per country, * This helps eliminate the issue of us having more than one textbook per country per year.by year_bin newid3 q33, sort: gen n_q33 = q33 if _n==1lab var n_q33 "N. Countries Discuss Global Citizenship Each Year"set more offlist year_bin country q33 n_q33*As is shown above, only one value is recorded for each country per year_bin, even if we have more than one.*How many countries mentioned global citizenship each year?cap drop s_q33bysort year_bin: egen s_q33=sum(n_q33)list year_bin country q33 n_q33 s_q33* How many total countries per year?cap drop s_country cap drop n_countryby year_bin newid3, sort: gen n_country = 1 if _n==1by year_bin, sort: egen s_country = sum(n_country)list year_bin country n_country s_countrycap drop cit_propgen cit_prop = (s_q33)/(s_country)lab var cit_prop "% Countries Discussing Global Citizenship Each Year"codebook cit_proplist year_bin cit_prop* Graph Both DVs on Same Axes#delimit ; 	graph twoway 	(qfit cit_prop year_bin if year_bin>1970, lc(black) lp(-))	(scatter cit_prop year_bin if year_bin>1970, mc(black) msymbol(O) msize(small))	(qfit mean_cit year_bin if year_bin>1970, lc(black))	(scatter mean_cit year_bin if year_bin>1970, mcolor(black) msym(S) msize(small))	,	subtitle("Mentions of Global Citizenship, 1970-2005")	xtitle("Year of Publication")	ytitle("Proportion")	legend(label(1 "Proportion of Textbooks")			label (2 "3-Year Average")			label(3 "Proportion of Countries")			label (4 "3-Year Average") row(2) pos(6)			order(1 3 2 4)
			size(*.8))	xlabel(1970[5]2005)	graphregion(color(white)); 		#delimit cr		************************************************************************** Graph 3: Globalization by Region*************************************************************************glob decade  = 10gen decade= $decade*int((pubdate)/$decade)lab def decade_label 1970 "1965-1975" 1980 "1975-1984" 1990 "1985-1994" 2000 "1995-2004"lab val decade decade_labelreplace decade = 1975 if decade==1970replace decade = 1985 if decade==1980replace decade = 1995 if decade==1990replace decade = 2005 if decade==2000drop if decade<1970egen regionXtime = concat(world_ decade)

preservecollapse (mean) globzn world_ decade, by(regionXtime) #delimit ; 
 	graph twoway (scatter globzn decade if world_==3, mc(gs5) msym(S))	(line globzn decade if world_==3, lc(gs5))
	
	(scatter globzn decade if world_==1, mc(gs5) msym(+))	(line globzn decade if world_==1, lc(gs5))		(scatter globzn decade if world_==2, mc(gs5) msym(O))	(line globzn decade if world_==2, lc(gs5))		(scatter globzn decade if world_==4, mc(gs5) msym(D))	(line globzn decade if world_==4, lc(gs5))		(scatter globzn decade if world_==5, mc(gs5) msym(T))	(line globzn decade if world_==5, lc(gs5))		(scatter globzn decade if world_==6, mc(gs5) msym(X))	(line globzn decade if world_==6, lc(gs5)),		subtitle("Proportion of Textbooks Mentioning Globalization by Region")	xtitle("Decade of Publication")	ytitle("Proportion Textbooks")	legend (row(2) order(1 "West" 3 "Latin America" 5 "Asia" 7 "Eastern Europe" 9 "Africa" 11 "MENA"))	xlabel(1975[10]2005)	graphregion(color(white))	; # delimit crrestore
************************************************************************** TABLE 2: Globalization**************************************************************************** Fill in missing data with global mean values ***foreach var in globzn q33 yrcent logpage gradecat citizens q34 q33 civ hrindex_all overallgl loggdp polity2 logngo mig_perc hrtreaty {	cap drop xbar_`var'	egen xbar_`var' = mean(`var')	replace `var' = xbar_`var' if `var'==.}set more off*Model 1 Just Level 1 Variablesxtmelogit globzn yrcent q34 hrindex_all logpage gradecat hist citizens || newid3: , or cov(unstruct) varianceest store m1*Model 2 With Level 2 Controlsxtmelogit globzn yrcent q34 hrindex_all logpage gradecat hist citizens loggdp overallgl mig_perc polity2 latcar eeur asia africa mena || newid3: , or cov(unstruct)est store m2set more off* Model 3 With Global Linkagesxtmelogit globzn yrcent q34 hrindex_all logngo logpage gradecat hist citizens loggdp overallgl mig_perc polity2 latcar eeur asia africa mena || newid3: , or cov(unstruct)est store m3* Model 4 With HR Linkagesxtmelogit globzn yrcent q34 hrindex_all hrtreaty logpage gradecat hist citizens loggdp overallgl mig_perc polity2 latcar eeur asia africa mena || newid3: , or cov(unstruct)est store m4estout m1 m2 m3 m4, ///	cells(b(star fmt(%4.3f)) se(par fmt(%4.3f))) stats(N bic p `sd(_cons)') eform	************************************************************************** TABLE 3: Global Citizenship*************************************************************************set more off*Model 1 Just Level 1 Variablesxtmelogit q33 yrcent q34 hrindex_all logpage gradecat hist citizens  || newid3: , cov(unstruct) orest store gc1*Model 2 With Level 2 Controlsxtmelogit q33 yrcent q34 hrindex_all logpage gradecat hist citizens loggdp overallgl mig_perc polity2 latcar eeur asia africa mena || newid3: , cov(unstruct) orest store gc2* Model 3 With Global Linkagesxtmelogit q33 yrcent q34 hrindex_all logngo logpage gradecat hist citizens loggdp overallgl mig_perc polity2 latcar eeur asia africa mena || newid3: , cov(unstruct) orest store gc3* Model 4 With HR Linkagesxtmelogit q33 yrcent q34 hrindex_all hrtreaty logpage gradecat hist citizens loggdp overallgl mig_perc polity2 latcar eeur asia africa mena || newid3: , cov(unstruct) orest store gc4estout gc1 gc2 gc3 gc4, ///	cells(b(star fmt(%4.3f)) se(par fmt(%4.3f))) stats(N bic p) eform			